.class public Lcom/alipay/android/app/sdk/AliPay;
.super Ljava/lang/Object;


# static fields
.field protected static final sLock:Ljava/lang/Object;


# instance fields
.field private final ALIPAY_APK_NAME:Ljava/lang/String;

.field private final MSP_APK_NAME:Ljava/lang/String;

.field private final URL:Ljava/lang/String;

.field private final URL_SANDBOX:Ljava/lang/String;

.field private isInstall:Z

.field private isSandbox:Z

.field private mContext:Landroid/app/Activity;

.field private mDownloadFailRunnable:Ljava/lang/Runnable;

.field private mDownloadType:Ljava/lang/String;

.field private mDownloadUrl:Ljava/lang/String;

.field private mHandler:Landroid/os/Handler;

.field private mInstallMessageAlert:Lcom/alipay/android/app/widget/CustomAlertDialog;

.field private mReceiver:Landroid/content/BroadcastReceiver;

.field private mTimeout:I

.field private mUrl:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    sput-object v0, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    return-void
.end method

.method public constructor <init>(Landroid/app/Activity;Landroid/os/Handler;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "https://mclient.alipay.com/gateway.do"

    iput-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->URL:Ljava/lang/String;

    const-string v0, "https://mobiletestabc.alipaydev.com/mobileclientgw/net/gateway.do"

    iput-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->URL_SANDBOX:Ljava/lang/String;

    const-string v0, "alipay_msp.apk"

    iput-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->MSP_APK_NAME:Ljava/lang/String;

    const-string v0, "alipay.apk"

    iput-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->ALIPAY_APK_NAME:Ljava/lang/String;

    new-instance v0, Lcom/alipay/android/app/sdk/AliPay$1;

    invoke-direct {v0, p0}, Lcom/alipay/android/app/sdk/AliPay$1;-><init>(Lcom/alipay/android/app/sdk/AliPay;)V

    iput-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadFailRunnable:Ljava/lang/Runnable;

    new-instance v0, Lcom/alipay/android/app/sdk/AliPay$2;

    invoke-direct {v0, p0}, Lcom/alipay/android/app/sdk/AliPay$2;-><init>(Lcom/alipay/android/app/sdk/AliPay;)V

    iput-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mReceiver:Landroid/content/BroadcastReceiver;

    iput-object p1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    if-eqz p2, :cond_0

    iput-object p2, p0, Lcom/alipay/android/app/sdk/AliPay;->mHandler:Landroid/os/Handler;

    :goto_0
    return-void

    :cond_0
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mHandler:Landroid/os/Handler;

    goto :goto_0
.end method

.method static synthetic access$0(Lcom/alipay/android/app/sdk/AliPay;)Landroid/app/Activity;
    .locals 1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    return-object v0
.end method

.method static synthetic access$1(Lcom/alipay/android/app/sdk/AliPay;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadUrl:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$10(Lcom/alipay/android/app/sdk/AliPay;)Ljava/lang/Runnable;
    .locals 1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadFailRunnable:Ljava/lang/Runnable;

    return-object v0
.end method

.method static synthetic access$11(Lcom/alipay/android/app/sdk/AliPay;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$12(Lcom/alipay/android/app/sdk/AliPay;Lcom/alipay/android/app/widget/CustomAlertDialog;)V
    .locals 0

    iput-object p1, p0, Lcom/alipay/android/app/sdk/AliPay;->mInstallMessageAlert:Lcom/alipay/android/app/widget/CustomAlertDialog;

    return-void
.end method

.method static synthetic access$2(Lcom/alipay/android/app/sdk/AliPay;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mUrl:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$3(Lcom/alipay/android/app/sdk/AliPay;)I
    .locals 1

    iget v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mTimeout:I

    return v0
.end method

.method static synthetic access$4(Lcom/alipay/android/app/sdk/AliPay;)V
    .locals 0

    invoke-direct {p0}, Lcom/alipay/android/app/sdk/AliPay;->downloadFile()V

    return-void
.end method

.method static synthetic access$5(Lcom/alipay/android/app/sdk/AliPay;)Lcom/alipay/android/app/widget/CustomAlertDialog;
    .locals 1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mInstallMessageAlert:Lcom/alipay/android/app/widget/CustomAlertDialog;

    return-object v0
.end method

.method static synthetic access$6(Lcom/alipay/android/app/sdk/AliPay;Z)V
    .locals 0

    iput-boolean p1, p0, Lcom/alipay/android/app/sdk/AliPay;->isInstall:Z

    return-void
.end method

.method static synthetic access$7(Lcom/alipay/android/app/sdk/AliPay;)Landroid/content/BroadcastReceiver;
    .locals 1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mReceiver:Landroid/content/BroadcastReceiver;

    return-object v0
.end method

.method static synthetic access$8(Lcom/alipay/android/app/sdk/AliPay;)Landroid/os/Handler;
    .locals 1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mHandler:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic access$9(Lcom/alipay/android/app/sdk/AliPay;)V
    .locals 0

    invoke-direct {p0}, Lcom/alipay/android/app/sdk/AliPay;->showInstallMessage()V

    return-void
.end method

.method private doDownLoad(ZLjava/lang/String;)V
    .locals 2

    new-instance v0, Lcom/alipay/android/app/sdk/AliPay$4;

    invoke-direct {v0, p0, p2, p1}, Lcom/alipay/android/app/sdk/AliPay$4;-><init>(Lcom/alipay/android/app/sdk/AliPay;Ljava/lang/String;Z)V

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mHandler:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method private doInstall(ZLjava/lang/String;Ljava/lang/String;)V
    .locals 2

    new-instance v0, Lcom/alipay/android/app/sdk/AliPay$3;

    invoke-direct {v0, p0, p3, p1, p2}, Lcom/alipay/android/app/sdk/AliPay$3;-><init>(Lcom/alipay/android/app/sdk/AliPay;Ljava/lang/String;ZLjava/lang/String;)V

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mHandler:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method private downloadFile()V
    .locals 4

    new-instance v0, Lcom/alipay/android/app/widget/Loading;

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-direct {v0, v1}, Lcom/alipay/android/app/widget/Loading;-><init>(Landroid/app/Activity;)V

    invoke-virtual {v0}, Lcom/alipay/android/app/widget/Loading;->show()V

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-virtual {v1}, Landroid/app/Activity;->getCacheDir()Ljava/io/File;

    move-result-object v1

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v2, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "/temp.apk"

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    new-instance v2, Lcom/alipay/android/app/util/FileDownloader;

    invoke-direct {v2}, Lcom/alipay/android/app/util/FileDownloader;-><init>()V

    iget-object v3, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadUrl:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/alipay/android/app/util/FileDownloader;->setFileUrl(Ljava/lang/String;)V

    invoke-virtual {v2, v1}, Lcom/alipay/android/app/util/FileDownloader;->setSavePath(Ljava/lang/String;)V

    new-instance v3, Lcom/alipay/android/app/sdk/AliPay$5;

    invoke-direct {v3, p0, v0, v1}, Lcom/alipay/android/app/sdk/AliPay$5;-><init>(Lcom/alipay/android/app/sdk/AliPay;Lcom/alipay/android/app/widget/Loading;Ljava/lang/String;)V

    invoke-virtual {v2, v3}, Lcom/alipay/android/app/util/FileDownloader;->setProgressOutput(Lcom/alipay/android/app/util/FileDownloader$IDownloadProgress;)V

    invoke-virtual {v2}, Lcom/alipay/android/app/util/FileDownloader;->start()V

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadFailRunnable:Ljava/lang/Runnable;

    const-wide/32 v2, 0x88b8

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    return-void
.end method

.method private processInstall(ZLjava/lang/String;Lorg/json/JSONObject;)V
    .locals 4

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getCacheDir()Ljava/io/File;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v0, "/temp.apk"

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    const-string v2, "safepay"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_4

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-string v2, "alipay_msp.apk"

    invoke-static {v1, v2, v0}, Lcom/alipay/android/app/util/Utils;->retrieveApkFromAssets(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_3

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v1}, Lcom/alipay/android/app/util/Utils;->is2G(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-direct {p0, p1, v0, p2}, Lcom/alipay/android/app/sdk/AliPay;->doInstall(ZLjava/lang/String;Ljava/lang/String;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v1, v0}, Lcom/alipay/android/app/util/Utils;->getApkInfo(Landroid/content/Context;Ljava/lang/String;)Landroid/content/pm/PackageInfo;

    move-result-object v1

    iget-object v1, v1, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;

    const-string v2, "downloadVersion"

    const-string v3, "3.5.4"

    invoke-virtual {p3, v2, v3}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/alipay/android/app/util/Utils;->compareVersion(Ljava/lang/String;Ljava/lang/String;)I

    move-result v1

    if-gez v1, :cond_2

    invoke-direct {p0, p1, p2}, Lcom/alipay/android/app/sdk/AliPay;->doDownLoad(ZLjava/lang/String;)V

    goto :goto_0

    :cond_2
    invoke-direct {p0, p1, v0, p2}, Lcom/alipay/android/app/sdk/AliPay;->doInstall(ZLjava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    :cond_3
    invoke-direct {p0, p1, p2}, Lcom/alipay/android/app/sdk/AliPay;->doDownLoad(ZLjava/lang/String;)V

    goto :goto_0

    :cond_4
    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    const-string v2, "alipay"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-string v2, "alipay.apk"

    invoke-static {v1, v2, v0}, Lcom/alipay/android/app/util/Utils;->retrieveApkFromAssets(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_7

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v1}, Lcom/alipay/android/app/util/Utils;->is2G(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_5

    invoke-direct {p0, p1, v0, p2}, Lcom/alipay/android/app/sdk/AliPay;->doInstall(ZLjava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    :cond_5
    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v1, v0}, Lcom/alipay/android/app/util/Utils;->getApkInfo(Landroid/content/Context;Ljava/lang/String;)Landroid/content/pm/PackageInfo;

    move-result-object v1

    iget-object v1, v1, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;

    const-string v2, "downloadVersion"

    const-string v3, "7.1.0.0701"

    invoke-virtual {p3, v2, v3}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/alipay/android/app/util/Utils;->compareVersion(Ljava/lang/String;Ljava/lang/String;)I

    move-result v1

    if-gez v1, :cond_6

    invoke-direct {p0, p1, p2}, Lcom/alipay/android/app/sdk/AliPay;->doDownLoad(ZLjava/lang/String;)V

    goto :goto_0

    :cond_6
    invoke-direct {p0, p1, v0, p2}, Lcom/alipay/android/app/sdk/AliPay;->doInstall(ZLjava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    :cond_7
    invoke-direct {p0, p1, p2}, Lcom/alipay/android/app/sdk/AliPay;->doDownLoad(ZLjava/lang/String;)V

    goto :goto_0
.end method

.method private showInstallMessage()V
    .locals 2

    new-instance v0, Lcom/alipay/android/app/sdk/AliPay$6;

    invoke-direct {v0, p0}, Lcom/alipay/android/app/sdk/AliPay$6;-><init>(Lcom/alipay/android/app/sdk/AliPay;)V

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mHandler:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method


# virtual methods
.method public pay(Ljava/lang/String;)Ljava/lang/String;
    .locals 13

    const/16 v12, 0xfa0

    const/16 v11, 0xf

    const/4 v10, 0x0

    new-instance v8, Lcom/alipay/android/app/widget/Loading;

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-direct {v8, v0}, Lcom/alipay/android/app/widget/Loading;-><init>(Landroid/app/Activity;)V

    invoke-virtual {v8}, Lcom/alipay/android/app/widget/Loading;->show()V

    const-string v7, ""

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v0}, Lcom/alipay/android/app/util/Utils;->getClientKey(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v0}, Lcom/alipay/android/app/util/Utils;->getClientId(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v0}, Lcom/alipay/android/app/util/Utils;->getAlixTid(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v3

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v0}, Lcom/alipay/android/app/util/Utils;->getNetConnectionType(Landroid/content/Context;)Lcom/alipay/android/app/util/NetConnectionType;

    move-result-object v0

    invoke-virtual {v0}, Lcom/alipay/android/app/util/NetConnectionType;->getName()Ljava/lang/String;

    move-result-object v5

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v0, ""

    invoke-direct {v4, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v0}, Lcom/alipay/android/app/util/Utils;->isExistMsp(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "safepay|"

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    :cond_0
    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v0}, Lcom/alipay/android/app/util/Utils;->isExistClient(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_3

    const-string v0, "alipay"

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    :cond_1
    :goto_0
    new-instance v9, Lcom/alipay/android/app/util/PayHelper;

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-direct {v9, v0}, Lcom/alipay/android/app/util/PayHelper;-><init>(Landroid/app/Activity;)V

    new-instance v0, Lcom/alipay/android/app/net/RequestData;

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    move-object v6, p1

    invoke-direct/range {v0 .. v6}, Lcom/alipay/android/app/net/RequestData;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    new-instance v1, Lcom/alipay/android/app/net/HttpClient;

    iget-object v2, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-direct {v1, v2}, Lcom/alipay/android/app/net/HttpClient;-><init>(Landroid/content/Context;)V

    iget-boolean v2, p0, Lcom/alipay/android/app/sdk/AliPay;->isSandbox:Z

    if-eqz v2, :cond_4

    const-string v2, "https://mobiletestabc.alipaydev.com/mobileclientgw/net/gateway.do"

    invoke-virtual {v1, v2}, Lcom/alipay/android/app/net/HttpClient;->setUrl(Ljava/lang/String;)V

    :goto_1
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "sdk request:"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/alipay/android/app/net/RequestData;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/alipay/android/app/util/LogUtils;->i(Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/alipay/android/app/net/RequestData;->toString()Ljava/lang/String;

    move-result-object v0

    const/4 v2, 0x0

    invoke-virtual {v1, v0, v2}, Lcom/alipay/android/app/net/HttpClient;->sendSynchronousRequest(Ljava/lang/String;Ljava/util/ArrayList;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v8}, Lcom/alipay/android/app/widget/Loading;->dismiss()V

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "sdk response:"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/alipay/android/app/util/LogUtils;->i(Ljava/lang/String;)V

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_d

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-string v2, "config"

    invoke-static {v1, v2}, Lcom/alipay/android/app/util/StoreUtils;->getValue(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "safepay"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_5

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v1}, Lcom/alipay/android/app/util/Utils;->isExistMsp(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_d

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Msp(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    :cond_2
    :goto_2
    return-object v0

    :cond_3
    const-string v0, "|"

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->indexOf(Ljava/lang/String;)I

    move-result v0

    const/4 v6, -0x1

    if-eq v0, v6, :cond_1

    const-string v0, "|"

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->indexOf(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->deleteCharAt(I)Ljava/lang/StringBuilder;

    goto/16 :goto_0

    :cond_4
    const-string v2, "https://mclient.alipay.com/gateway.do"

    invoke-virtual {v1, v2}, Lcom/alipay/android/app/net/HttpClient;->setUrl(Ljava/lang/String;)V

    goto :goto_1

    :cond_5
    const-string v2, "alipay"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_6

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v1}, Lcom/alipay/android/app/util/Utils;->isExistClient(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_d

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Client(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_2

    :cond_6
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_d

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v0}, Lcom/alipay/android/app/util/Utils;->isExistMsp(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_7

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Msp(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_2

    :cond_7
    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v0}, Lcom/alipay/android/app/util/Utils;->isExistClient(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_8

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Client(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_2

    :cond_8
    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getCacheDir()Ljava/io/File;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v0, "/temp.apk"

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-string v2, "alipay_msp.apk"

    invoke-static {v1, v2, v0}, Lcom/alipay/android/app/util/Utils;->retrieveApkFromAssets(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_a

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-virtual {v1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-static {}, Lcom/alipay/android/app/lib/ResourceMap;->getString_install_msp()I

    move-result v2

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, v10, v0, v1}, Lcom/alipay/android/app/sdk/AliPay;->doInstall(ZLjava/lang/String;Ljava/lang/String;)V

    sget-object v1, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Object;->wait()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_3
    :try_start_1
    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    iget-boolean v0, p0, Lcom/alipay/android/app/sdk/AliPay;->isInstall:Z

    if-eqz v0, :cond_9

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Msp(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :catch_0
    move-exception v0

    :try_start_2
    invoke-static {v0}, Lcom/alipay/android/app/util/LogUtils;->printExceptionStackTrace(Ljava/lang/Object;)V

    goto :goto_3

    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    throw v0

    :cond_9
    invoke-static {}, Lcom/alipay/android/app/sdk/Result;->getPayResult()Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_a
    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-string v2, "alipay.apk"

    invoke-static {v1, v2, v0}, Lcom/alipay/android/app/util/Utils;->retrieveApkFromAssets(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_c

    iget-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-virtual {v1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-static {}, Lcom/alipay/android/app/lib/ResourceMap;->getString_install_alipay()I

    move-result v2

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, v10, v0, v1}, Lcom/alipay/android/app/sdk/AliPay;->doInstall(ZLjava/lang/String;Ljava/lang/String;)V

    sget-object v1, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    sget-object v0, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Object;->wait()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1
    .catch Ljava/lang/InterruptedException; {:try_start_3 .. :try_end_3} :catch_1

    :goto_4
    :try_start_4
    monitor-exit v1
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    iget-boolean v0, p0, Lcom/alipay/android/app/sdk/AliPay;->isInstall:Z

    if-eqz v0, :cond_b

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Client(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :catch_1
    move-exception v0

    :try_start_5
    invoke-static {v0}, Lcom/alipay/android/app/util/LogUtils;->printExceptionStackTrace(Ljava/lang/Object;)V

    goto :goto_4

    :catchall_1
    move-exception v0

    monitor-exit v1
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_1

    throw v0

    :cond_b
    invoke-static {}, Lcom/alipay/android/app/sdk/Result;->getPayResult()Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_c
    const/16 v0, 0x1772

    invoke-static {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getResultState(I)Lcom/alipay/android/app/sdk/ResultStatus;

    move-result-object v0

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getStatus()I

    move-result v1

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getMsg()Ljava/lang/String;

    move-result-object v0

    const-string v2, ""

    invoke-static {v1, v0, v2}, Lcom/alipay/android/app/sdk/Result;->parseResult(ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_d
    new-instance v1, Lcom/alipay/android/app/net/ResponseData;

    invoke-direct {v1, v0}, Lcom/alipay/android/app/net/ResponseData;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Lcom/alipay/android/app/net/ResponseData;->getParams()Lorg/json/JSONObject;

    move-result-object v0

    if-nez v0, :cond_e

    invoke-static {v12}, Lcom/alipay/android/app/sdk/ResultStatus;->getResultState(I)Lcom/alipay/android/app/sdk/ResultStatus;

    move-result-object v0

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getStatus()I

    move-result v1

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getMsg()Ljava/lang/String;

    move-result-object v0

    const-string v2, ""

    invoke-static {v1, v0, v2}, Lcom/alipay/android/app/sdk/Result;->parseResult(ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_e
    const-string v1, "state"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "7001"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_f

    const-string v2, "errorMessage"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v1

    const-string v2, ""

    invoke-static {v1, v0, v2}, Lcom/alipay/android/app/sdk/Result;->parseResult(ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_f
    const-string v2, "9000"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_18

    const-string v1, "alixtid"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iget-object v2, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-static {v2}, Lcom/alipay/android/app/util/Utils;->getAlixTid(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_10

    iget-object v2, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-string v3, "alix_tid"

    invoke-static {v2, v3, v1}, Lcom/alipay/android/app/util/StoreUtils;->putValue(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    :cond_10
    const-string v1, "config"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "safepay"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_11

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-string v2, "safepay"

    invoke-static {v0, v1, v2}, Lcom/alipay/android/app/util/StoreUtils;->putValue(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Msp(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_11
    const-string v2, "alipay"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_12

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-string v2, "alipay"

    invoke-static {v0, v1, v2}, Lcom/alipay/android/app/util/StoreUtils;->putValue(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Client(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_12
    const-string v2, "wap"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_13

    const-string v1, "timeout"

    invoke-virtual {v0, v1, v11}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I

    move-result v1

    const-string v2, "url"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    new-instance v2, Landroid/content/Intent;

    iget-object v3, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    const-class v4, Lcom/alipay/android/app/sdk/WapPayActivity;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    new-instance v3, Landroid/os/Bundle;

    invoke-direct {v3}, Landroid/os/Bundle;-><init>()V

    const-string v4, "url"

    invoke-virtual {v3, v4, v0}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    const-string v0, "timeout"

    invoke-virtual {v3, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    invoke-virtual {v2, v3}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mContext:Landroid/app/Activity;

    invoke-virtual {v0, v2}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V

    sget-object v1, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_6
    sget-object v0, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Object;->wait()V
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_2
    .catch Ljava/lang/InterruptedException; {:try_start_6 .. :try_end_6} :catch_2

    :goto_5
    :try_start_7
    monitor-exit v1
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_2

    invoke-static {}, Lcom/alipay/android/app/sdk/Result;->getPayResult()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_2

    const/16 v0, 0x1771

    invoke-static {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getResultState(I)Lcom/alipay/android/app/sdk/ResultStatus;

    move-result-object v0

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getStatus()I

    move-result v1

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getMsg()Ljava/lang/String;

    move-result-object v0

    const-string v2, ""

    invoke-static {v1, v0, v2}, Lcom/alipay/android/app/sdk/Result;->parseResult(ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :catch_2
    move-exception v0

    :try_start_8
    invoke-static {v0}, Lcom/alipay/android/app/util/LogUtils;->printExceptionStackTrace(Ljava/lang/Object;)V

    goto :goto_5

    :catchall_2
    move-exception v0

    monitor-exit v1
    :try_end_8
    .catchall {:try_start_8 .. :try_end_8} :catchall_2

    throw v0

    :cond_13
    const-string v2, "wap_sdk"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_15

    const-string v1, "timeout"

    invoke-virtual {v0, v1, v11}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I

    move-result v1

    iput v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mTimeout:I

    const-string v1, "downloadUrl"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadUrl:Ljava/lang/String;

    const-string v1, "downloadMessage"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "url"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/alipay/android/app/sdk/AliPay;->mUrl:Ljava/lang/String;

    const-string v2, "downloadType"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    const/4 v2, 0x1

    invoke-direct {p0, v2, v1, v0}, Lcom/alipay/android/app/sdk/AliPay;->processInstall(ZLjava/lang/String;Lorg/json/JSONObject;)V

    sget-object v1, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_9
    sget-object v0, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Object;->wait()V
    :try_end_9
    .catchall {:try_start_9 .. :try_end_9} :catchall_3
    .catch Ljava/lang/InterruptedException; {:try_start_9 .. :try_end_9} :catch_3

    :goto_6
    :try_start_a
    monitor-exit v1
    :try_end_a
    .catchall {:try_start_a .. :try_end_a} :catchall_3

    iget-boolean v0, p0, Lcom/alipay/android/app/sdk/AliPay;->isInstall:Z

    if-eqz v0, :cond_1a

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    const-string v1, "safepay"

    invoke-static {v0, v1}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_14

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Msp(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :catch_3
    move-exception v0

    :try_start_b
    invoke-static {v0}, Lcom/alipay/android/app/util/LogUtils;->printExceptionStackTrace(Ljava/lang/Object;)V

    goto :goto_6

    :catchall_3
    move-exception v0

    monitor-exit v1
    :try_end_b
    .catchall {:try_start_b .. :try_end_b} :catchall_3

    throw v0

    :cond_14
    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    const-string v1, "alipay"

    invoke-static {v0, v1}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_1a

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Client(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_15
    const-string v2, "download"

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_17

    const-string v1, "downloadUrl"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadUrl:Ljava/lang/String;

    const-string v1, "downloadMessage"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "downloadType"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    invoke-direct {p0, v10, v1, v0}, Lcom/alipay/android/app/sdk/AliPay;->processInstall(ZLjava/lang/String;Lorg/json/JSONObject;)V

    sget-object v1, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_c
    sget-object v0, Lcom/alipay/android/app/sdk/AliPay;->sLock:Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Object;->wait()V
    :try_end_c
    .catchall {:try_start_c .. :try_end_c} :catchall_4
    .catch Ljava/lang/InterruptedException; {:try_start_c .. :try_end_c} :catch_4

    :goto_7
    :try_start_d
    monitor-exit v1
    :try_end_d
    .catchall {:try_start_d .. :try_end_d} :catchall_4

    iget-boolean v0, p0, Lcom/alipay/android/app/sdk/AliPay;->isInstall:Z

    if-eqz v0, :cond_1a

    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    const-string v1, "safepay"

    invoke-static {v0, v1}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_16

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Msp(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :catch_4
    move-exception v0

    :try_start_e
    invoke-static {v0}, Lcom/alipay/android/app/util/LogUtils;->printExceptionStackTrace(Ljava/lang/Object;)V

    goto :goto_7

    :catchall_4
    move-exception v0

    monitor-exit v1
    :try_end_e
    .catchall {:try_start_e .. :try_end_e} :catchall_4

    throw v0

    :cond_16
    iget-object v0, p0, Lcom/alipay/android/app/sdk/AliPay;->mDownloadType:Ljava/lang/String;

    const-string v1, "alipay"

    invoke-static {v0, v1}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_1a

    invoke-virtual {v9, p1}, Lcom/alipay/android/app/util/PayHelper;->pay4Client(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_17
    const-string v0, "exit"

    invoke-static {v1, v0}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_1a

    invoke-static {v12}, Lcom/alipay/android/app/sdk/ResultStatus;->getResultState(I)Lcom/alipay/android/app/sdk/ResultStatus;

    move-result-object v0

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getStatus()I

    move-result v1

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getMsg()Ljava/lang/String;

    move-result-object v0

    const-string v2, ""

    invoke-static {v1, v0, v2}, Lcom/alipay/android/app/sdk/Result;->parseResult(ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_18
    const-string v0, "4001"

    invoke-static {v1, v0}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_19

    invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-static {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getResultState(I)Lcom/alipay/android/app/sdk/ResultStatus;

    move-result-object v0

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getStatus()I

    move-result v1

    invoke-virtual {v0}, Lcom/alipay/android/app/sdk/ResultStatus;->getMsg()Ljava/lang/String;

    move-result-object v0

    const-string v2, ""

    invoke-static {v1, v0, v2}, Lcom/alipay/android/app/sdk/Result;->parseResult(ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_19
    const-string v0, "5001"

    invoke-static {v1, v0}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_1a

    invoke-virtual {p0, p1}, Lcom/alipay/android/app/sdk/AliPay;->pay(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_2

    :cond_1a
    invoke-static {}, Lcom/alipay/android/app/sdk/Result;->getPayResult()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_1b

    invoke-static {}, Lcom/alipay/android/app/sdk/Result;->getPayResult()Ljava/lang/String;

    move-result-object v0

    :goto_8
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "sdk result:"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/alipay/android/app/util/LogUtils;->i(Ljava/lang/String;)V

    goto/16 :goto_2

    :cond_1b
    move-object v0, v7

    goto :goto_8
.end method

.method public setSandBox(Z)V
    .locals 0

    iput-boolean p1, p0, Lcom/alipay/android/app/sdk/AliPay;->isSandbox:Z

    return-void
.end method
